<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class LotteryResult extends Model
{
   protected $table = 'lottery_result';
   protected $guarded = ['id'];

   public function gift()
   {
   		return $this->belongsTo(Gift::class);
   } 

   public function giftType()
   {
   		$typename = '';
   		switch ($this->gift_type) {
   			case '1':
   				$typename = '纪念奖';
   				break;
   			case '50':
   				$typename = '二等奖';
   				break;
   			case '100':
   				$typename = '一等奖';
   				break;	
   			default:
   				# code...
   				break;
   		}
   		return $typename;
   }
}
